package com.younion.common.constants;


public enum Template{
	
	NAME("NAME","姓名"),
	SEX("SEX","性别"),
	COMPANY("COMPANY", "公司"),
	TIME("TIME", "时间"),
	SCORE("SCORE","可用积分"),
	GIFT("GIFT", "兑换礼品"),
	MONEY("MONEY", "会员卡余额"),
	DAY("DAY", "天数"),
	COUNT("COUNT", "可用次数"),
	ADDMONEY("ADDMONEY", "充值金额"),
	ADDCOUNT("ADDCOUNT", "充值次数"),
	COSTCOUNT("COSTCOUNT", "消费次数"),
	ADDSCORE("ADDSCORE", "充值积分"),
	COSTSCORE("COSTSCORE", "消费积分"),
	COSTMONEY("COSTMONEY", "消费金额"),
	PRODUCT("PRODUCT", "商品"),
	CUSTOMER("CUSTOMER", "商家");
	
	
	private static final String L_SPLIT = "{";
	private static final String R_SPLIT = "}";
	private static final String ENCODE = "\\";
	private String name;
	private String title;

	private Template(String name,String title) {
		this.name = name;
		this.title = title;
	}

	public String getName() {
		return name;
	}
	
	public String getTitle(){
		return title;
	}
	
	public String getTitleValiable(){
		return L_SPLIT + title + R_SPLIT;
	}
	
	public String getTitleValiablePattern(){
		return ENCODE + L_SPLIT + title + ENCODE +R_SPLIT;
	}

	public static MsgStatus valueOfName(String name) {
		for (MsgStatus e : MsgStatus.values()) {
			if (e.getName().equals(name)) {
				return e;
			}
		}
		return null;
	}

	public static void main(String[] args) {
		System.out.print(Template.valueOfName("COMPANY"));
	}
	
}
